@import '../variable.less';

.bar-checkbox {
  color: @text-color;
  display: inline-block;
  margin-right: 10px;
  font-size: @text-normal;
  margin-bottom: 10px;
  label {
    display: flex;
    align-items: center;
  }

  input {
    width: 0;
    height: 0;
    opacity: 0;
  }

  &__block {
    transition: all 0.25s;
    cursor: pointer;

    display: inline-flex;
    width: 16px;
    height: 16px;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
    border-radius: @border-radius-base;
    border: 2px solid @border-color-base;
  }

  input:checked + &__block {
    transition: all 0.25s;
    background-color: @primary-color;
    border-color: @primary-dark;
    &::after {
      cursor: pointer;
      content: ' ';
      display: inline-block;
      width: 10px;
      height: 4px;
      border: 3px solid @white;
      border-right: 0;
      border-top: 0;
      transform: rotate(-45deg) scale(1) translate(5%, -15%);
    }
  }

  &__text {
    cursor: pointer;
    white-space: nowrap;
  }

  &.disabled {
    .bar-checkbox {
      &__block {
        background-color: #ebedf4;
      }
      &__text {
        color: @text-color-disabled;
      }
    }
    input:checked + .bar-checkbox__block {
      transition: all 0.25s;
      background-color: @primary-light2;
      border-color: @primary-dark2;
      &::after {
        cursor: pointer;
        content: ' ';
        display: inline-block;
        width: 10px;
        height: 4px;
        border: 3px solid @white2;
        border-right: 0;
        border-top: 0;
        transform: rotate(-45deg) scale(1) translate(5%, -15%);
      }
    }
  }

  &-group {
    display: flex;
    flex-wrap: wrap;
    &.vertical {
      flex-direction: column;
    }
  }
}
